﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using DLL;
using Model;
namespace WebApplication2
{
    /// <summary>
    /// Reqisrter 的摘要说明
    /// </summary>
    public class Reqisrter : IHttpHandler
    {

        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            UserModel us = new UserModel();
            us.UserID = context.Request["UserPhone"];
            us.UserName = context.Request["UserName"];
            us.UserPwd = context.Request["UserPwd"];
            if (!UserInfoBLL.SelectUser(us.UserID))
            {
                if (UserInfoBLL.InserInfoBLL(us))
                {
                    context.Response.Write(2);
                }
                else
                {
                    context.Response.Write(3);
                }
            }
            else
            {
                context.Response.Write(1);
            }            
        }
        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}